Component({
  properties: {
    show: {
      type: String
    }
  },

  data: {
    moduleList: [],
    curIndex: 0,
    showCover: false
  },
  ready() {
    let moduleList = wx.getStorageSync('moduleList');
    this.setData({
      moduleList
    })
    setTimeout( () => {
      this.setData({
        showCover: true
      })
    })
  },
  pageLifetimes: {
    
  },
  methods: {
    selcetBar( e ) {
      let index = e.currentTarget.dataset.index;
      let moduleList = this.data.moduleList;
      if (index === this.data.curIndex) return

      this.setData({
        curIndex: index,
        // showCover: false
      })

      // setTimeout( () => {
      //   this.setData({
      //     showCover: true
      //   })
      // })
      this.triggerEvent('changeBar', {
        curModule: moduleList[index]
      })
    }
  }
})